﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Framework.Manager;
using Framework.UI;
using Framework.Util;
using Game.Data.Api;

namespace Game.UI
{
    public class MainPanelController : ControllerBase<MainPanelView>
    {
        protected override void OnInit()
        {
            RegisterButton("UIButton", OnClickUIButton);
            RegisterToggle("UIToggle", OnValueChangeUIToggle);
            RegisterSlider("UISlider", OnValueChangeBeginUISlider, ExSlider.EnumCallbackType.ValueChangeBegin);
            RegisterSlider("UISlider", OnValueChangeUISlider);
            RegisterSlider("UISlider", OnValueChangeEndUISlider, ExSlider.EnumCallbackType.ValueChangeEnd);
        }

        private void OnClickUIButton()
        {
            Debug.Log("OnClickUIButton");
        }

        private void OnValueChangeUIToggle(bool pIsOn)
        {
            Debug.Log($"OnValueChangeUIToggle pIsOn:{pIsOn}");
        }

        private void OnValueChangeBeginUISlider(float pValue)
        {
            Debug.Log($"<color=green>OnValueChangeBeginUISlider pValue:{pValue}</color>");
        }

        private void OnValueChangeUISlider(float pValue)
        {
            Debug.Log($"OnValueChangeUISlider pValue:{pValue}");
        }

        private void OnValueChangeEndUISlider(float pValue)
        {
            Debug.Log($"<color=red>OnValueChangeEndUISlider pValue:{pValue}</color>");
        }
    }
}